# -*- coding: UTF-8 -*-
"""
@author: tgy
@file: demo01.py
@time: 2022/03/10
"""
import requests


def test01():
    ...
    # lizhiqiao@uniontech.com
    # Y4yhl9t!

    login_url = "https://cooperation.uniontech.com/wwwapi/Login/MDAccountLogin"

    data = {"password": "", "isCookie": False, "captchaType": 0, "account": "lizhiqiao@uniontech.com"}

    headers = {
        "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36",
        "referer": "https://cooperation.uniontech.com/network"
    }

    requests.session().post(url=login_url, data=data, )


def test02():
    ...
    # cookie: md_pss_id=01201006407507b06b0db08f06d08603b0930b00240a70b8
    load_url = "https://cooperation.uniontech.com/wwwapi/Worksheet/GetFilterRows"
    headers = {
        "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36",
        "referer": "https://cooperation.uniontech.com/app/8ed12597-5f06-4501-ba3a-689c1da6b437/5fa4eb6bb023180e387f54be/5fa4ec7e7e29f70c868ca686",
        "cookie": "md_pss_id=01201006407507b06b0db08f06d08603b0930b00240a70b8",
        "authorization": "md_pss_id 01201006407507b06b0db08f06d08603b0930b00240a70b8"
    }

    data = {
        "worksheetId": "5fa4ec7e7e29f70c868ca686",
        "pageSize": 270,
        "pageIndex": 1,
        "status": 1,
        "appId": "8ed12597-5f06-4501-ba3a-689c1da6b437",
        "viewId": "5fa4ec7e7e29f70c868ca68a",
        "sortControls": [],
            "notGetTotal": True,
        "searchType": 1,
        "keyWords": "",
        "filterControls": [],
        "fastFilters": [],
        "navGroupFilters": []
            }
    response = requests.post(load_url, headers=headers, data=data)
    print(response.content)


if __name__ == '__main__':
    pass
    # test02()